From: emellor@ewan Date: Fri, 23 Sep 2005 15:50:02 +0000 (+0100) Subject: Move ImageHandler.create call to initDomain, after the call to xc.domain_create. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~16770^2~1^2~11 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=9b0cb01573ef705fd2ad9fc1430d18f0c668e877;p=xen.git Move ImageHandler.create call to initDomain, after the call to xc.domain_create. This ensures that ImageHandler has the correct domain ID available to it, which seems sensible in general, and is necessary for the VMX VNC support in particular. Signed-off-by: Ewan Mellor --- diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index 8180eda9ac..384a8275c3 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -614,7 +614,7 @@ class XendDomainInfo: sxpr.append(['maxmem', self.info['maxmem_KiB'] / 1024]) if self.infoIsSet('device'): - for (n, c) in self.info['device']: + for (_, c) in self.info['device']: sxpr.append(['device', c]) def stateChar(name): @@ -706,13 +706,6 @@ class XendDomainInfo: """ # todo - add support for scheduling params? try: - if 'image' not in self.info: - raise VmError('Missing image in configuration') - - self.image = ImageHandler.create(self, - self.info['image'], - self.info['device']) - self.initDomain() # Create domain devices. @@ -737,6 +730,14 @@ class XendDomainInfo: self.domid = xc.domain_create(dom = self.domid or 0, ssidref = self.info['ssidref']) + + if 'image' not in self.info: + raise VmError('Missing image in configuration') + + self.image = ImageHandler.create(self, + self.info['image'], + self.info['device']) + if self.domid <= 0: raise VmError('Creating domain failed: name=%s' % self.info['name'])